import * as readline from 'readline';
import { Process } from '../scene';

export class Ws {

    public message: { name: "", resolve: ()=> void }[] = [];

    public send (process: Process){
        
        return this.test(process);

    }

    public test (p: Process){

        return new Promise((resovle)=> {
            const rl = readline.createInterface({
                input: process.stdin,
                output: process.stdout
            });
            
            rl.question(p.text, (answer) => {
                rl.close();
                resovle(answer);
            });
        })

    }

    // 抽卡
    public chouka (){
        
        this.message.push({
            name: "",
            resolve: ()=>{

            }
        })

    }

}